package nl.hanze.designpatterns.DAOFactory.impl;

import nl.hanze.designpatterns.DAO.LoginCredentialDAO;
import nl.hanze.designpatterns.DAO.impl.file.crypted.LoginCredentialsDAOImplFileCrypted;
import nl.hanze.designpatterns.DAOFactory.AbstractFactory;
import nl.hanze.designpatterns.domain.LoginCredential;

public class ConcreteFactoryFile implements AbstractFactory {
	
	public LoginCredentialDAO createLogin(String type){
		if(type=="file"){
			return new LoginCredentialsDAOImplFileCrypted();
		}
		return null;
	}

	@Override
	public boolean checkLogin(LoginCredential lc) {
		LoginCredentialsDAOImplFileCrypted lcdf = new LoginCredentialsDAOImplFileCrypted();
		return lcdf.isValid(lc);
	}

}
